<%= msg if msg!=''-%>

<ul class="mylist">
<% for e in @events -%>
<li id="item_<%=e[:id]%>">
<b><%= date = e[:date] %></b>
<b><%= e[:project] %></b>
<%= e[:title] %>
(
<% if(date != nil) -%>
<% if(date == Date.today) -%>
<div class="duetoday">today !</div>
<% elsif(date > Date.today and date <= Date.today+1) -%>
<div class="duetoday">tomorrow!</div>
<% elsif(date > Date.today and date <= Date.today+3) -%>
<div class="duenear"><%= time_ago_in_words(date+1) %></div>
<% elsif(date > Date.today) -%>
<div class="duefutur"><%= time_ago_in_words(date+1) %></div>
<% elsif(date < Date.today) -%>
<div class="duepast"><%= time_ago_in_words(date) + " ago !" %></div>
<% end -%>
<% end -%>
)
<% if e[:type]=='cal' %>
<a href="#" onclick="del_event(<%=e[:id]%>);return false;"><img id="de<%=e[:id]%>" src="/images/delete.gif" border="0"></a>
<% end %>
</li>
<% end -%>
</ul>

